import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sr = new Scanner(System.in);
        int n = sr.nextInt();
        if(n<=0){
            System.out.println("input error");
            return;
        }
        int[] J = new int[n];
        int[] F = new int[n];
        double[] F2 = new double[n];
        double sum = 0;
        int sum2 = 0;
        for(int i =0;i<n;i++){
            J[i] = sr.nextInt();
            if(J[i]<0||J[i]>100){
                System.out.println("grad error");
                return;
            }
            if(J[i]>=60){
                F2[i] = (double)J[i]/10-5;
            }
            else{
                F2[i] = 0;
            }
            F[i] = sr.nextInt();
            if(F[i]<1||F[i]>5){
                System.out.println("credit error");
                return;
            }
            sum += F[i]*F2[i];
            sum2 += F[i];
        }
        double x = (double)sum/sum2;
        System.out.printf("GPA is %.2f",x);
        sr.close();
    }
}